<?php
add_action( 'init', 'preview' );
function preview() {
	register_taxonomy(
		'coursepreview',
		'course',
		array(
			'label' => __( 'Manager Preview' ),
			'rewrite' => array( 'slug' => 'course-category'),
			'hierarchical' => true
		)
	);
	
	register_post_type( 'preview',
		array(
			'labels' => array(
				'name' => __( 'preview' ),
				'singular_name' => __( 'Demo_post_typepreview' ),
				'add_new' => _x('Add New', 'preview'),
				'add_new_item' => __('Add preview'),
				'edit_item' => __('Edit preview'),
				'new_item' => __('New demo post typepreview'),
				'view_item' => __('View preview'),
				'search_items' => __('Search preview')
			),
		'public' => true,
		'publicly_queryable' => true,
		'has_archive' => true,
		'hierarchical' => false,
		'taxonomies' => array('coursepreview'),
		'supports' => array( 'title', 'editor', 'author',  'comments', 'custom-fields', 'cats')
		)
	);
}